package com.cq.hd.admin.controller;

import com.cq.hd.admin.annotation.RequiresPermissionsDesc;
import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.TbMerchantEnterApplyApi;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.AdminMerchantEnterApplyPageVo;
import com.cq.hd.member.api.vo.AppMerchantEnterApplyPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 商户入驻申请记录表 前端控制器
 * </p>
 */
@Api(tags = "商户入驻审核相关接口")
@Slf4j
@RestController
@RequestMapping("/merchantEnterApply")
public class TbMerchantEnterApplyController {

    @Autowired
    private TbMerchantEnterApplyApi merchantEnterApplyApi;

    @ApiOperation(value = "商户入驻申请列表")
    @ApiImplicitParam(name = "merchantEnterApplyPageDto", value = "实体", paramType = "query", dataType = "MerchantEnterApplyPageDto")
    @ApiResponse(response = AdminMerchantEnterApplyPageVo.class, code = 200, message = "接口返回对象参数")
//    @RequiresPermissions("merchant:merchantEnterApply:list")
    @RequiresPermissionsDesc(menu = {"商户入驻审核管理", "商户入驻审核管理"}, button = "查询")
    @GetMapping("/page")
    public Result<Page<AdminMerchantEnterApplyPageVo>> pageBusinessEnterApply(MerchantEnterApplyPageDto merchantEnterApplyPageDto) {
        return merchantEnterApplyApi.pageAdminMerchantEnterApply(merchantEnterApplyPageDto);
    }

    @ApiOperation(value = "商户入驻详情")
    @ApiImplicitParam(name = "id", value = "id", required = true, paramType = "query", dataType = "Long")
    @ApiResponse(response = AppMerchantEnterApplyPageVo.class, code = 200, message = "接口返回对象参数")
    @GetMapping("/details")
    public Result<AppMerchantEnterApplyPageVo> details(Long id) {
        return merchantEnterApplyApi.details(id);
    }
}
